/**
 * caicongyang.com Inc.
 * Copyright (c) 2004-2017 All Rights Reserved.
 */
package com.caicongyang.design.flyweight;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author caicongyang1
 * @version id: webSiteFactory, v 0.1 17/5/24 下午7:42 caicongyang1 Exp $$
 */
public class WebSiteFactory {
    private Map<String, ConcreteWebSite> flyWeights = new ConcurrentHashMap();

    public WebSite getWebSiteCategory(String key) {

        if (!flyWeights.containsKey(key)) {
            flyWeights.put(key, new ConcreteWebSite(key));
        }
        return flyWeights.get(key);
    }

}
